export function setStorage(key, data) {
	uni.setStorage({
		key,
		data,
		success: () => {
			return Promise.resolve()
		},
		fail: () => {
			return Promise.reject()
		}
	});
}

export function setStorageSync(key, data) {
	uni.setStorageSync(key, data);
}

export function getStorage(key) {
	uni.getStorage({
		key,
		success: () => {
			return Promise.resolve()
		},
		fail: () => {
			return Promise.reject()
		}
	})
}

export function getStorageSync(key) {
	return uni.getStorageSync(key)
}

export function getStorageInfo() {
	return new Promise((resolve, reject) => {
		uni.getStorageInfo({
			success: (res) => {
				resolve(res)
			},
			fail: (error) => {
				reject(error)
			}
		});
	})
}

export function getStorageInfoSync() {
	return uni.getStorageInfoSync()
}

export function removeStorage(key) {
	uni.removeStorage({
		key,
		success: () => {
			return Promise.resolve()
		},
		fail: () => {
			return Promise.reject()
		}
	});
}

export function removeStorageSync(key) {
	uni.removeStorageSync(key)
}

export function clearStorage() {
	uni.clearStorage()
}

export function clearStorageSync() {
	uni.clearStorageSync()
}
